<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean"
           prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html"
           prefix="html" %>

<%@page import="com.sql.Sql" %>
<%@page import="java.util.List" %>
<html>
    <head>
        <meta http-equiv="Content-Type"
              content="text/html; charset=UTF-8">
        <title>Struts - Musica</title>
        <style type="text/css">
            @import "/musica/musica.css";
        </style>
    </head>
    <body>
        <p>&nbsp;</p>
        <p class="titulo">Nuevo CD</p>
        <html:form action="logCd">
            <html:hidden property="accion" value="INS" />
            <table border="0">
                <tr>
                    <td>Cd</td>
                    <td>
                        <html:select property="idCategoria">
                            <%
        List list = Sql.consulta(
                "SELECT idCategoria,categoria " +
                "FROM categorias");
        for (int fil = 1; fil < list.size(); ++fil) {
            Object[] fila = (Object[]) list.get(fil);%>
                            <html:option
                                value="<%=fila[0].toString()%>">
                                <%=fila[1].toString()%>
                            </html:option>
                            <%}%>
                        </html:select>
                    </td>
                </tr>
                <tr>
                    <td>T&iacute;tulo</td>
                    <td>
                        <html:text property="titulo"
                                   size="30" maxlength="50" />
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>
                        <html:errors
                            property="titulo" />
                    </td>
                </tr>
                <tr>
                    <td class="center" colspan="2"><br>
                        <html:submit value="Grabar" />
                    </td>
                </tr>
            </table>
        </html:form>
        <p class="center">
            <a href="/musica/portada.html">Cancelar</a>
        </p>
    </body>
</html>


